package org.linlinjava.litemall.db.domain;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.ibatis.type.JdbcType;
import org.linlinjava.litemall.db.handler.ListMapStringTypeHandler;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

@TableName(value = "litemall_cash_settlement",autoResultMap = true)
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class LitemallCashSettlement {
    @TableId(type = IdType.AUTO)
    private Integer id;

    private Integer userId;
    private Integer shopId;
    private BigDecimal orderCash;
    @TableField(value = "`change`")
    private BigDecimal change;
    private BigDecimal deserveCash;
    private BigDecimal differenceAmount;
    @TableField(jdbcType = JdbcType.VARCHAR,typeHandler = ListMapStringTypeHandler.class)
    private List<Denomination> denominationMap;
    private String deviceNo;
    private BigDecimal actualCash;
    private BigDecimal estimateCash;
    private BigDecimal initialCash;
    private BigDecimal refundCash;
    private BigDecimal receiveCash;
    private Integer type;
    private LocalDateTime lastCheck;
    /**
     * 添加时间
     */
    private LocalDateTime addTime;

    /**
     * 更新时间
     */
    private LocalDateTime updateTime;

    /**
     * 删除
     */
    @TableLogic
    private Boolean deleted;

    @TableField(exist = false)
    private String username;
    @TableField(exist = false)
    private String shopName;

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class Denomination{
        private BigDecimal price;
        private Integer number;
    }


}
